tt = [[1, [0, 0]], [2, [1, 1]], [3, [1, 2]], [2, [1, 4]], [2, [3, 1]], [6, [3, 2]], [2, [3, 4]], [8, [4, 2]],
      [8, [4, 3]], [8, [5, 1]], [8, [5, 4]]]

tt.sort(key=lambda sh: sh[0]*10000+sh[1][0]*100+sh[1][1],reverse=False)

print(tt)
